package hu.dobrosi.j2me.io;

import java.io.IOException;
import java.io.InputStreamReader;

public class BufferedReader {
	private InputStreamReader inputStreamReader;

	public BufferedReader(InputStreamReader inputStreamReader) {
		this.inputStreamReader = inputStreamReader;
	}

	public String readLine() throws IOException {
		int c;
		String s = null;
		do {
			c = inputStreamReader.read();
			if (c != '\r' && c != -1) {
				if (s == null) {
					s = "";
				}
				s += (char) c;
			}
		} while (c != -1 && c != '\n');
		return s;
	}
}
